package NC;

public class NC30 {
    public static int minNumberdisappered (int[] arr) {
        // write code here
        boolean[] f = new boolean[1000000];
        for (int i = 0; i < arr.length; i++) {
            if(arr[i]>=0){
                f[arr[i]] = true;
            }
        }
        for (int i = 1; i < f.length; i++) {
            if(!f[i]) {
                return i;
            }
        }
        return 0;
    }

    public static void main(String[] args) {
        System.out.println(minNumberdisappered(new int[]{-1, 2, 3, 4}));
    }
}
